#include <baker/Triangle.h>
#include <unittest++/UnitTest++.h>

using namespace baker;

SUITE( TestTriangle )
{
    TEST( sizeof )
    {
        CHECK_EQUAL( sizeof( Triangle ), sizeof( float ) * 9 );
    }

    TEST( getNormal )
    {
        CHECK( Triangle( Vec3( 0, 0, 1 )
                       , Vec3( 1, 0, 0 )
                       , Vec3(-1, 0, 0 )
                       ).getNormal() == Vec3( 0, 1, 0 )
             );

        CHECK( Triangle( Vec3( 0, 1, 0 )
                       , Vec3( 0, 0, 1 )
                       , Vec3( 0, 0,-1 )
                       ).getNormal() == Vec3( 1, 0, 0 )
             );

        CHECK( Triangle( Vec3( 0, 1, 0 )
                       , Vec3(-1, 0, 0 )
                       , Vec3( 1, 0, 0 )
                       ).getNormal() == Vec3( 0, 0, 1 )
             );
    }
}
